﻿<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" autoFlush="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%request.setAttribute("curDate",new java.util.Date());%>
<c:set var="i" value="1"/>
<c:forEach var="question" items="${questions}">
    <c:if test="${i%2 > 0}">
    <c:set var="tdclass" value="one"/>
    </c:if>
    <c:if test="${i%2 == 0}">
    <c:set var="tdclass" value="two"/>
    </c:if>
    <c:set var="i" value="${i+1}"/>
    <c:set var="qtitle" value="${question.title}"/>
    <c:set var="char1" value="'"/>
    <c:set var="char2" value="\'"/>
    <c:if test="${fn:contains(qtitle, char1)}">
        <c:set var="qtitle" value="${fn:replace(qtitle, char1, char2)}"/>
    </c:if>
    <c:set var="differ" value="${(curDate.time-question.postDate.time)/3600000}"/>
    <c:if test="${differ <= 48}">
            <c:set var="newIcon" value="<font color=\"#FF0000\" title=\"48小时内新帖子\">(new)</font>"/> 
    </c:if>
    <c:if test="${differ > 48}">
        <c:set var="newIcon" value=""/> 
    </c:if>
document.writeln('<li class="<c:out value="${tdclass}"/>"><span class="rssLinkListItemTitle"><a href="<%=request.getContextPath()%>/question.mrqa?action=view&id=<c:out value="${question.id}"/>"><c:out value="${qtitle}" escapeXml="false"/></a></span><c:out value="${newIcon}" escapeXml="false"/></li>');
</c:forEach>

